package com.xxx.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;

/**
 * kafka消息监听器
 */
@Slf4j
@Service
public class KafkaConsumerListener {

    @KafkaListener(topics = "test", groupId = "my-group")
    public void receiveMessage(String message) {
        log.info("Received message: {}", message);
    }
}